<template>
  <view class="body">
    <!-- <view class="nav">
      <uni-nav-bar
        left-icon="back"
        title="详情"
        fixed="true"
        status-bar="true"
        @clickLeft="goback"
      ></uni-nav-bar>
    </view> -->
    <view class="box">
      <web-view :src="src"></web-view>
    </view>
  </view>
</template>
<script>
import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
export default {
  components: { uniNavBar },
  onLoad(e) {
    if (e) {
      if (e.subject) {
        this.src = e.src + "?subject=" + e.subject;
      } else {
        this.src = e.src;
      }
    }
    console.log(this.src);
    // var that = this;
    // that.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
    // var w = plus.webview.create(
    //   that.src,
    //   "id",
    //   {
    //     top: uni.getSystemInfoSync().statusBarHeight + 44, //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的，可以继续降低TOP值
    //     //因为设置top之后 webview的高度依然不变会往下移 底部会被遮住  所以设置一下高度
    //     height:
    //       uni.getSystemInfoSync().windowHeight -
    //       44 -
    //       uni.getSystemInfoSync().statusBarHeight,
    //   },
    //   {
    //     preload: "preload webview",
    //   }
    // ); // 可直接通过以下方法获取preload值
    // var currentWebview = this.$mp.page.$getAppWebview(); //获取当前页面的webview对象
    // currentWebview.append(w); //一定要append到当前的页面里！！！才能跟随当前页面一起做动画，一起关闭
  },
  data() {
    return {
      src: "",
      webviewStyles: {
        progress: {
          color: "#FF3333",
        },
      },
    };
  },
  methods: {
    goback() {
      uni.reLaunch({
        url: `../index`,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
/* .body {
  position: relative;
}
.nav {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}
.box {
  position: absolute;
  top: 100upx;
  left: 0;
  z-index: 1;
} */
</style>